package com.tpp.controller;


import com.tpp.Service.cinemaService;

import com.tpp.pojo.baseVo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RequestMapping("/cinema")
@RestController
public class cinemaController {
    @Autowired
    com.tpp.Service.cinemaService cinemaService;
    @GetMapping("/findall")
   public BaseResult findall(@RequestParam("page")Integer page, @RequestParam("size")Integer size){
//       BaseResult baseResult = new BaseResult();
//       BaseResult all = cinemaService.findAll();
//       baseResult.setData(all);
//       baseResult.setCode(1);
//       baseResult.setMsg("查询成功");
       return cinemaService.findAll(page, size);
   }
   @PostMapping("findBycinemaAdderssId")
   public  BaseResult findBycinemaAdderssId(@RequestBody Map map){
   return cinemaService.findBycinemaAdderssId(Integer.valueOf(map.get("id").toString()));
   }
   public BaseResult findBycinemaAdderssIdandcinemaScore(@RequestBody Map map, @RequestParam("cinemaScore") Double cinemaScore ){
        return cinemaService.findBycinemaAdderssIdandcinemaScore(Integer.valueOf(map.get("id").toString()), cinemaScore );
    }


}
